<!--{eval 
	$_TPL['pagetypes'] = array('header'=>'页头', 'rightside'=>'内容页面', 'footer'=>'页脚', 'couplet'=>'对联', 'contenttop'=>'页面主区域上方', 'contentbottom'=>'页面主区域下方', 'feedbox'=>'动态置顶位');
	$_TPL['availables'] = array('0'=>'-', '1'=>'有效');
}-->
<!--{template admin/tpl/header}-->

<div class="mainarea">
<div class="maininner">

<div class="tabs_header">
	<ul class="tabs">
		<li$actives[view]><a href="admincp.php?ac=game"><span>浏览游戏</span></a></li>
		<li class="null"><a href="admincp.php?ac=game&op=add">添加新游戏</a></li>
	</ul>
</div>

		
<!--{if empty($_GET['op'])}-->

	<form method="post" action="admincp.php?ac=game">
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
	<div class="bdrcontent">
		
		<div class="title">
			<h3>已添加游戏</h3>
			<p>以下列表为已经添加的游戏</p>
		</div>
		
		<table cellspacing="0" cellpadding="0" class="formtable">
		<tr>
			<th>游戏名</th>
			<th width="50%">游戏swf的路径</th>
			<th width="8%">校区ID</th>
			<th width="8%">编辑</th>
		</tr>
		<!--{loop $listvalue $key $value}-->
		<tr>
			<td><input type="checkbox" name="adids[]" value="$value[game_id]"> $value[game_name]</td>
			<td><a href="$value[game_rule_url]">$value[game_url]</a></td>
			<td>$value[school_id]</td>
			<td><a href="admincp.php?ac=game&op=edit&adid=$value[game_id]&gameid=$value[game_id]">编辑</a></td>
		</tr>
		<!--{/loop}-->
		</table>

		<br />
		
	</div>
	
	<div class="footactions">
		<input type="checkbox" name="chkall" onclick="checkAll(this.form, 'adid')">全选
		<input type="submit" name="delsubmit" value="批量删除" class="submit">
	</div>
	
	</form>

<!--{elseif $_GET['op'] == 'add' || $_GET['op'] == 'edit'}-->
	<script type="text/JavaScript">
	function style_show(theobj) {
		var styles,key;
		styles = new Array('html','flash','image','text');
		for(key in styles){
			var obj=$('style_'+styles[key]);
			obj.style.display = styles[key]==theobj.options[theobj.selectedIndex].value?'':'none';
		}
	}
	</script>

	<form method="post" action="admincp.php?ac=game" enctype="multipart/form-data">
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
	
	<div class="bdrcontent">
		
		<table cellspacing="0" cellpadding="0" class="formtable">
		<tr><th>游戏名称</th>
		<td><input name="game_name" value="$advalue[game_name]" class="t_input"></td>
		</tr>

		<tr><th>游戏规则上传(请使用英文名)</th>
		<td><input name="game_rule_url" value="$advalue[game_rule_url]" class="t_input"><br/><input type="file" name="gamefile"/> </td>
		</tr>

		<tr><th>游戏swf的路径</th>
		<td><input name="game_url" value="$advalue[game_url]" class="t_input"></td>
		</tr>

		<tr><th>校区ID</th>
		<td>
		<select name="school_id">
		<!--{loop $fieldinfo $v}-->
			<option value="$v[fieldid]" {if $v[fieldid] == $advalue[school_id]}selected="selected" {/if}>$v[title]</option>
		<!--{/loop}-->
		</select></td><!--<input name="school_id" value="$advalue[school_id]" class="t_input">-->
		</tr>
		</table>
	</div>
	
	<div class="footactions">
		<input type="hidden" name="gameid" value="$advalue[game_id]">
		<input type="submit" name="adsubmit" value="提交" class="submit">
	</div>

	</form>
	
<!--{elseif $_GET['op'] == 'tpl'}-->
	<div class="bdrcontent">
	<div class="title"><h3>模版调用代码</h3></div>
	
	<table class="formtable">
	<tr><td>请将以下代码复制，放到站点模板的任意页面的指定位置即可。</td></tr>
	<tr><td><input type="text" name="blockadcode" value="$adcode" size="80"></td></tr>
	</table>
	</div>

<!--{elseif $_GET['op'] == 'js'}-->

	<div class="bdrcontent">
	<div class="title"><h3>Javascript调用代码</h3></div>
	
	<table class="formtable">
	<tr><td><textarea name="blockadcode" style="width:98%;" rows="5">$adcode</textarea></td></tr>
	</table>
	</div>
<!--{/if}-->
</div>
</div>

<div class="side">
	<!--{template admin/tpl/side}-->
</div>

<!--{template admin/tpl/footer}-->